@extends('layouts.appDomain')

@section('content')
    <div class="container py-5">
        <div class="row justify-content-center">
            <div class="col-md-12">
                <div class="card panel">
                    <div class="card-header">角色列表</div>

                    <div class="card-body">
                        <div class=" table-responsive">
                        <table class="table">
                            <tr>
                                <th>角色名称</th>
                                <th>等级</th>
                                <th>职业</th>
                                <th>种族</th>
                                <th>累计在线时间</th>
                                <th>在线状态</th>
                                @if(config('conf.serverDef.payforlevel')==1)
                                    <th>付费服务</th>
                                @endif
                            </tr>
                            @foreach($characters as $c)
                                <tr>
                                    <td>{{$c->name}}</td>
                                    <td>{{$c->level}}</td>
                                    <td>{{ApApp\Helper::GetClass($c->class)}}</td>
                                    <td>{{ApApp\Helper::ChrRaces($c->race)}}</td>
                                    <td>
                                        <span id="totaltime_{{$c->guid}}">{{floor($c->totaltime/60)}}</span> 分钟

                                        @if(config('conf.serverDef.timetomoney')==1)
                                            <button type="button" class="btn btn-primary btn-sm timetomoney" data='{{$c->guid}}'>兑换{{floor($c->totaltime/3600)}}金币</button>
                                        @endif
                                    </td>
                                    <td>
                                        @if($c->online==1)
                                            <i class="fas fa-check-circle text-success"></i>
                                        @else
                                            <i class="fas fa-minus-circle text-muted"></i>
                                        @endif
                                    </td>
                                    @if(config('conf.serverDef.payforlevel')==1)
                                        <td>
                                            <!-- <button type="button" class="btn btn-primary btn-sm">改名</button> -->
                                            @if($c->level<80)
                                                <!-- <button type="button" class="btn btn-primary btn-sm uplv" data='{{$c->guid}}' disabled>升级</button> -->
                                                <a href="/user/levelUp/{{$c->guid}}" class="btn btn-primary btn-sm" target="_blank">升级</a>
                                            @endif
                                        </td>
                                    @endif
                                </tr>
                            @endforeach

                        </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
